<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <script>
    var names = ["abc", "cba", "nba", "mba", "bba", "aaa", "bbb"]
    for (var i = 0; i < names.length; i++) {
      console.log(names[i])
      if (names[i] === "nba") {
        break
      }
    }
    console.log("======================================")

    for (var i = 0; i < names.length; i++) {
      if (names[i] === "nba") {
        continue
      }
      console.log(names[i])
    }

  </script>
</body>

</html>